import java.util.*;

public class TestRotateRight {
    public static void main(String[] args) {
        int[] list = {3, 8, 19, 7};
        rotateRight(list);
        System.out.println(Arrays.toString(list));   // [7, 3, 8, 19]
        rotateRight(list);
        rotateRight(list);
        System.out.println(Arrays.toString(list));   // [8, 19, 7, 3]
        rotateRight(list);
        System.out.println(Arrays.toString(list));   // [3, 8, 19, 7]
        rotateRight(list);
        rotateRight(list);
        rotateRight(list);
        System.out.println(Arrays.toString(list));   // [8, 19, 7, 3]
        rotateRight(list);
        rotateRight(list);
        rotateRight(list);
        rotateRight(list);
        System.out.println(Arrays.toString(list));   // [8, 19, 7, 3]
    }

    public static int[] rotateRight(int[] list) {
        int[] temp = new int[4];
        for (int i = 0; i < list.length; i++) {
            temp[i] = list[i];
        }
        list[0] = temp[3];
        for (int i = 1; i < list.length; i++) {
            list[i] = temp[i - 1];
        }
        return list;
    }
}